package com.mxx.springaction;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class KnightMain {
    public static void main(String[] args) {
        //配置类形式的上下文
        ClassPathXmlApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("Knight.xml");
        //获取bean
        Knight bean = applicationContext.getBean(Knight.class);
        bean.embarkOnQequest();
        applicationContext.close();
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(CDplayerConfig.class);
        Performance performance = annotationConfigApplicationContext.getBean(Performance.class);
        performance.perform();
    }
}
